import { Route, RouteConfig } from "vue-router";
import List from '@/pages/address/list.vue';
import Add from '@/pages/address/add.vue';
import { ROUTE_NAME } from "@/lib/constant";

export const routes: RouteConfig[] = [
    {
        path: '/address/list',
        name: ROUTE_NAME.ADDRESS_LIST,
        meta: {
            title: '地址管理',
        },
        component: List,
    },
    {
        path: '/address/add/:addressId?',
        name: ROUTE_NAME.ADDRESS_ADD,
        meta: {
            title: (to: Route) => {
                return to.params.addressId ? '修改地址' : '添加地址';
            },
        },
        component: Add,
    },
];
